package com.onepiece.shipelves.common.utils;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author wangxj
 * @Desc: 队列util
 * @date 2019-11-28
 */
public class QueueUtil {

    /**
     * QUEUE 先进先出
     *
     * @param queue
     * @param value
     * @param <T>
     */
    public static <T> void addQueue(ArrayBlockingQueue<T> queue, T value) {
        if (queue.remainingCapacity() == 0) {
            queue.poll();
        }
        queue.add(value);
    }


}
